import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/layout.vue'
import User from '@/views/usre.vue'
import Info from '@/views/info.vue'
import LookHouse from '@/views/look-house.vue'
import Article from '@/views/article.vue'
import City from '@/views/city.vue'
import Login from '@/views/login.vue'
import House from '@/views/houses.vue'
import Map from '@/views/map.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/article',
    children: [
      { path: 'article', component: Article },
      { path: 'user', component: User },
      { path: 'info', component: Info },
      { path: 'lookhouse', component: LookHouse }
    ]
  },
  { path: '/Map', component: Map },
  { path: '/city', component: City },
  { path: '/login', component: Login },
  { path: '/house/:id', component: House }
]

const router = new VueRouter({
  routes
})

export default router
